<template>
  <el-card>
      <h1>商品添加</h1>
      <el-divider/>
      <vue-wangeditor id="editor" ref="editor" v-model="text"></vue-wangeditor>
      <el-divider/>
      <el-button type="primary" @click="getHtml">获取html</el-button>
  </el-card>
</template>

<script>
// 导入vue-wangeditor
import vueWangeditor  from 'vue-wangeditor';
export default {
    components:{
        vueWangeditor 
    },
    data(){
        return {
            text:'<h1>富文本编辑器</h1>'
        }
    },
    methods:{
        getHtml(){
            console.log(this.$refs.editor.getHtml());
        }
    }
}
</script>

<style>

</style>